<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://qzone.qq.com/1678513665/page" prefix="p"%>
<%@page import="org.netEase.controller.*"%>
<%@page import="org.netEase.dao.*"%>
<%@page import="org.netEase.dao.impl.*"%>
<%@page import="org.netEase.entity.*"%>
<%@page import="org.netEase.util.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<title>Insert title here</title>
<style type="text/css">
#tfa{width:99%;border:solid 1px #DDDDDD;background-color:white;}
#tfa tr{line-height:23px}
#tfa tr th{background-color:#F5FAFE;border:solid 1px #DDDDDD;}
#tfa tr td{border:solid 1px #DDDDDD;}

#goumai{
	width:100%;
	background-color:rgba(0,0,20,0.5);
	height: -webkit-fill-available;
	position:absolute;
	 top:0px;
	left:0px;
	display:none;
	position: fixed;
	z-index:10000000;
}
.cle:after{
	content:'';
	display:block;
	clear:both;
}

.paging{
margin-left:150px;
}
.current{
font-size:16px;
color:orange;
}
</style>
</head>
<body>
<div id="goumai">
<div>
<div id="goumai003" style="margin:120px auto;width:600px;height:330px;background-color:white;border: 1px solid #bfbfbf ;margin:20px auto;box-shadow: 0px 0px 10px 5px #848484; ">

<div id="loginClose" style="background-color:#EEEDEF;height: 30px" ><span style="margin-left: 10px">回复用户</span><span style="float: right;  ;width: 60px;height: 25px;text-align: center;">关闭</span></div>
<form action="comments.shtml" method="post">
<div>

<p style="margin-left: 10px"><span>用户：</span><span id="users"></span></p>
<p style="margin-left: 10px"><span>商品号：</span><span id="comsids"></span></p>
<p style="margin-left: 10px"><span>评论：</span><span id="comtent"></span></p>
<p  style="margin-left: 10px">输入您的回复</p>
<textarea rows="6" cols="80" name="rtext" style="margin-left: 10px">
</textarea>
<input type="hidden" name="hid"id="hids">
<input type="hidden" name="coid" id="coids">

<input type="submit" value="确认回复" style="color:white; width: 100px;background-color: #5A98DD; height: 30px;border: none;margin-left: 487px;margin-top: 20px;">


</div>
</form>
</div>





</div>
</div>
<form action="comments.shtml" method="get" id="form1">

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 评论管理 <span class="c-gray en">&gt;</span> 意见反馈 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<select  class="lis" name="hid" style="width: 98%;height:25px ">
<option value="-1">全部</option>
<c:forEach var="li" items="${list}">
<option value="${li.hid}">${li.name}</option>
</c:forEach>


</select>

<div class="page-container">

	<div class="mt-20">
		<table id="tfa">
			<thead>
				<tr class="text-c">
					<th  style="text-align: center;">ID</th>
					<th  style="text-align: center;">用户名</th>
					<th  style="text-align: center;">商品简略图</th>
					<th  style="text-align: center;">留言内容</th>
					<th  style="text-align: center;">发表日期</th>
					<th  style="text-align: center;">操作</th>
				</tr>
			</thead>
			<thead>
			<tbody>
			
				<c:forEach items="${comment}" var="comment">
					<tr class="">
					<td>${comment.id}</td>
					<td>${comment.yonghu.namesp}</td>
					<td ><img src="../images/index/${comment.com_images}" alt=""width="150px"></td>
					<td style="text-align: left;"><div></div>${comment.com_content}</td>	
					<td>${comment.com_date}</td>
					<td><span><a href="delecommentss.shtml?ids=${comment.id}">删除</a></span><span class="huifu" data="${comment.id }">回复</span> </td>
					
						</tr>
				</c:forEach>	
			
			</tbody>
		</table>
			</div>
	</div>
	 <div> 
	       <p:page pageBean="${pageBean}"/>
	    </div>
	    </form>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>  
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
	$(".huifu").click(function(){
		var commentid = $(this).attr("data");
		$.get("commentsAdmin.shtml",{"comsid":commentid},function(data){
			$("#users").html(data.com_hName);
			$("#comsids").html(data.sid);
			$("#comtent").html(data.com_content);
			$("#hids").val(data.com_hid);
			$("#coids").val(data.id);
			
		})
		$("#goumai").fadeIn(300);
		setTimeout(function(){
			$("#goumai003").show(400);
		}, 250)
	}
	)
	$("#loginClose").click(function(){
		$("#goumai003").fadeOut(250);
		setTimeout(function(){
			$("#goumai").slideUp(240);
		}, 240)
	})
	
	$('.table-sort').dataTable({
		"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,2,4]}// 制定列不参与排序
		]
	});

});
/*用户-添加*/ 
 
$(function(){
	$(".lis").val("${hid}");
	$(".lis").change(function(){
		$("#form1").trigger("submit");
	})
})
function member_add(title,url,w,h){
	layer_show(title,url,w,h);
}
/*用户-查看*/
function member_show(title,url,id,w,h){
	layer_show(title,url,w,h);
}
/*用户-停用*/
function member_stop(obj,id){
	layer.confirm('确认要停用吗？',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="member_start(this,id)" href="javascript:;" title="启用"><i class="Hui-iconfont">&#xe6e1;</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已停用</span>');
		$(obj).remove();
		layer.msg('已停用!',{icon: 5,time:1000});
	});
}

/*用户-启用*/
function member_start(obj,id){
	layer.confirm('确认要启用吗？',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="member_stop(this,id)" href="javascript:;" title="停用"><i class="Hui-iconfont">&#xe631;</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已启用</span>');
		$(obj).remove();
		layer.msg('已启用!',{icon: 6,time:1000});
	});
}
/*用户-编辑*/
function member_edit(title,url,id,w,h){
	layer_show(title,url,w,h);
}
/*密码-修改*/
function change_password(title,url,id,w,h){
	layer_show(title,url,w,h);	
}
/*用户-删除*/
function member_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: '',
			dataType: 'json',
			success: function(data){
				$(obj).parents("tr").remove();
				layer.msg('已删除!',{icon:1,time:1000});
			},
			error:function(data) {
				console.log(data.msg);
			},
		});		
	});
}
</script>

</body>
</html>